#include <iostream>
#include <vector>
#include <yvals.h>
using namespace std;

int getMaxMinDifference(const std::vector<int>& data) {
    // 使用 std::max_element 和 std::min_element 查找最大值和最小值
    auto maxIt = std::max_element(data.begin(), data.end());
    auto minIt = std::min_element(data.begin(), data.end());

    // 计算最大值和最小值的差
    return *maxIt - *minIt;
}
class Solution {
public:
    bool canCross(vector<int>& stones) {
        size_t n = stones.size();
        size_t Size = getMaxMinDifference(stones) + 1;
        vector<vector<bool>> dp(n + 1, vector<bool>(Size + 1, false));
        dp[0][0] = true;
        for (int i = 1; i < n; ++i) {
            for (int j = 0; j < i; ++j) {
                int k = stones[i] - stones[j];
                dp[i][k] = dp[j][k - 1] || dp[j][k] || dp[j][k + 1];
            }
        }
        for (int i = 0; i < n; ++i) {
            if (dp[n - 1][i]) return true;
        };
        return false;
    }
};
int main() {
    vector<vector<bool>> dp(5, vector<bool>(5, false));
    dp[7][7] = 1;
    std::cout << dp[7][7];
    // Solution a;
    // vector<int> data = {0, 1, 3, 6, 7};
    // cout << a.canCross(data);
}